package com.atxiaodei.springbootmybatisplus.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * @ClassName User
 * @Deacription TODO
 * @Author 王盟
 * @Date 2021/3/18 14:48
 * @Version 1.0
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {

    private static final long serialVersionUID = -562113207165027279L;

  // 对应的数据库中的主键（uuid，自增id，雪花算法，redis，zookeeper）
    @TableId(type = IdType.ASSIGN_ID) //默认的雪花算法
    private Long id;

    private String name;

    private Integer age;

    private String email;

    @Version
    private Integer version;

    @TableField(fill= FieldFill.INSERT)
    private Date createTime;

    @TableField(fill= FieldFill.INSERT_UPDATE)
    private Date updateTime;

    private Integer deleted;
}
